package com.lemner.ke.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lemner.ke.R;
import com.lemner.ke.bean.RichClassifyBean;
import com.lemner.ke.bean.RichClassifyListBean;

public class LibraryLeftAdapter extends BaseQuickAdapter<RichClassifyListBean,BaseViewHolder>{
    private int postion=0;
    public LibraryLeftAdapter(int layoutResId) {
        super(layoutResId);
    }
    public void setPostion(int postion){
        this.postion=postion;
    }
    @Override
    protected void convert(BaseViewHolder helper, RichClassifyListBean item) {
        if (item!=null) {
            if (item.getTitle()!=null){
                helper.setText(R.id.tv_content, item.getTitle());
            }
        }
        int layoutPosition = helper.getLayoutPosition();
        if (layoutPosition==postion){
            helper.itemView.setBackgroundColor(0xffffffff);
            helper.setTextColor(R.id.tv_content, 0xffd09c00);
        }else{
            helper.itemView.setBackgroundColor(0xfff2f2f8);
            helper.setTextColor(R.id.tv_content, 0xff000000);
        }
        if (layoutPosition==0&&postion==0){
        }
    }
}
